-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:[CI-15236]: Added IMAGE_TAR_PATH as output variable for the plugin. #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a validation check to ensure the directory for plugin_tar_path exists before use by making use of filepath.Dir
, you can add this in if p.Build.TarPath != ""
also add some ut's to cover the same functionality for edge scenarios like in case of privileged and non-privileged k8s scenarios
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI jobs are failing with the below error though it succeeds in local - remove the use /root
dir in the tests, and may be rely on DRONE_WORKSPACE as it's common for both Drone and Harness or better use os.MkdirTemp
go: downloading golang.org/x/text v0.3.7
Warning: tar_path is empty
--- FAIL: TestTarPathValidation (0.00s)
--- FAIL: TestTarPathValidation/invalid_path_no_permissions (0.00s)
kaniko_test.go:239: Expected empty tar path, got non-empty string
FAIL
FAIL github.com/drone/drone-kaniko 0.006s
ok github.com/drone/drone-kaniko/cmd/kaniko-acr 0.005s
ok github.com/drone/drone-kaniko/cmd/kaniko-docker 0.004s
? github.com/drone/drone-kaniko/cmd/kaniko-gar [no test files]
ok github.com/drone/drone-kaniko/cmd/kaniko-ecr 0.011s
? github.com/drone/drone-kaniko/cmd/kaniko-gcr [no test files]
ok github.com/drone/drone-kaniko/pkg/artifact 0.002s
ok github.com/drone/drone-kaniko/pkg/docker 0.004s
--- FAIL: TestWritePluginOutputFile (0.01s)
--- FAIL: TestWritePluginOutputFile/invalid_output_path (0.00s)
output_test.go:87: Expected error, got none
FAIL
FAIL github.com/drone/drone-kaniko/pkg/output 0.011s
removed as getTarPath is only called when tarPath isn't empty
IMAGE_TAR_PATH is now accessible via a output variable and can also be used in STO steps as expression -
<+steps.STEP_ID.output.outputVariables.IMAGE_TAR_PATH>